<%@page import="util.TextFormat"%>
<%@page import="java.util.Date"%>
<%@ page language="java" contentType="text/html;charset=utf-8" pageEncoding="utf-8"%>
<%@page import="entity.Book"%>
<%
	Book book = (Book)request.getAttribute("book");
	if(book == null){
		book = new Book();
	}
	
%>
<HTML>
<HEAD>
<TITLE>图书 - 当当网</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
<LINK href="<%=request.getContextPath()%>/product_files/dangdang.css" type="text/css" rel="Stylesheet">
<LINK href="<%=request.getContextPath()%>/product_files/book.css" type="text/css" rel="stylesheet">
<script type="text/javascript"  src="<%=request.getContextPath()%>/js/jquery-1.4.3.js"></script>
<script type="text/javascript">
	function buy(id) {
	<%
		if(request.getAttribute("user") == null){
	%>
			window.location.href = "<%=request.getContextPath()%>/user/logInOut/toLogin.do";
	<%
		} else {
	%>
			jQuery.noConflict();
			jQuery.ajax({
				type:"POST",
				url:"<%=request.getContextPath()%>/cart/buy.do",
				data:"id=" + id,
				beforeSend:function(){
					jQuery("#buy").attr("src","<%=request.getContextPath()%>/images/window_loading.gif");
				},
				success: function(msg){
					if(msg === 'true'){
						jQuery("#cartInfo").attr("style", "color:green;").html("购买成功");
						jQuery("#buy").attr("src","<%=request.getContextPath()%>/images/buttom_goumai.gif");
						setTimeout(function(){
							jQuery("#cartInfo").attr("style", "").html("");
						},2000);
					} else {
						jQuery("#cartInfo").attr("style", "color:red;").html("您已经购买");
						jQuery("#buy").attr("src","<%=request.getContextPath()%>/images/buttom_goumai.gif");
						setTimeout(function(){
							jQuery("#cartInfo").attr("style", "").html("");
						},2000);
					}
				}
			});
	<%
		}
	%>
	}
</script>
</HEAD>
<BODY>
<DIV id="tag_box" style="DISPLAY: none; Z-INDEX: 10; POSITION: absolute"></DIV>
<DIV id="div_shield"></DIV>
<DIV id="main">
	<DIV class="mainsearch"></DIV>
	<DIV class="wrap"></DIV><!--left start-->
		<!--left end-->
	<DIV class="right">
		<DIV class="right_wai">
			<DIV class="shuming">
				<DIV class="shuming_left">
					<SPAN class="black000"><A class="top_bk"></A><%=book.getProduct_name()%></SPAN>
				</DIV>
				<DIV class="book_case">
					<SPAN class="seriesname">丛书名： <%=book.getProduct_name()%></SPAN>
				</DIV>
				<DIV class="empty_box"></DIV>
			</DIV>
			<DIV class="book_left">
				<DIV class="book_pic">
					<A href="javascript:;" class="bigpicture_bk">
						<IMG id="img_show_prd" src="<%=request.getContextPath()%>/productImages/<%=book.getProduct_pic()%>">
					</A>
				</DIV>
				<INPUT id="hid_largepictureurl" type="hidden">
			</DIV>
			<DIV class="book_right">
				<DIV id="author_">作　　者： <%=book.getAuthor()%></DIV>
				<DIV id="publisher_">出 版 社：<%=book.getPublishing()%> </DIV>
				<UL>
					<LI>出版时间： <%=TextFormat.formatToYMD(book.getPublish_time())%></LI>
					<LI>字　　数： <%=book.getWord_number()%></LI>
					<LI>版　　次： <%=book.getWhich_edtion()%></LI>
					<LI>页　　数： <%=book.getTotal_page()%></LI>
					<LI>印刷时间： </LI>
					<LI>开　　本： 16开 </LI>
					<LI>印　　次：<%=book.getPrint_time()%> </LI>
					<LI>纸　　张： 胶版纸 </LI>
					<LI>I S B N ： <%=book.getIsbn()%></LI>
					<LI>包　　装： 平装 </LI>
				</UL>
				<DIV id="__categroy_bk">所属分类：
					<A class="blue12a" href="http://product.dangdang.com/category.ashx?code=01.00.00.00.00.00" target="_blank">图书</A> &gt;&gt; 
					<A class="blue12a" href="http://product.dangdang.com/category.ashx?code=01.30.00.00.00.00" target="_blank">社会科学</A> &gt;&gt; 
					<A class="blue12a" href="http://product.dangdang.com/category.ashx?code=01.30.07.00.00.00" target="_blank">教育</A> &gt;&gt; 
					<A class="blue12a" href="http://product.dangdang.com/category.ashx?code=01.30.07.04.00.00" target="_blank">各级教育</A>
				</DIV>
				<DIV class="jiage">
					<SPAN class="gray87">定价：
						<SPAN class="del" id="originalPriceTag">￥<%=TextFormat.formatNumber(book.getFixed_price())%></SPAN>
					</SPAN>
					<SPAN class="redc30">当当价：￥<%=TextFormat.formatNumber(book.getDang_price())%><B></B></SPAN> 
					节省：￥<%=TextFormat.formatNumber(book.getFixed_price() - book.getDang_price())%> 
					<DIV class="pd_buy_num"><DIV class="clear"></DIV></DIV>
					<DIV class="goumai">
						<a href="javascript:buy(<%=book.getId()%>);" title="购买" class="purchase_book">
							<IMG  id="buy" src="<%=request.getContextPath()%>/product_files/booksale.gif"/>
							<span id="cartInfo"></span>
						</a>
					</DIV>

				</DIV>
			</DIV>
			<DIV id="dvTPUrls"></DIV>
			<DIV id="__zhinengbiaozhu_bk">
				<DIV class="dashed"></DIV>
				<H2 class="black14"><IMG src="<%=request.getContextPath()%>/product_files/bg_point1.gif" align="absMiddle"> 内容简介</H2>
				<DIV class="zhengwen"><%=book.getDescription()%></DIV>
				<DIV class="dashed"></DIV>
				<H2 class="black14"><IMG src="<%=request.getContextPath()%>/product_files/bg_point1.gif" align="absMiddle"> 作者简介</H2>
				<DIV class="zhengwen"><%=book.getAuthor()%><%=book.getAuthor_summary()%></DIV>
				<DIV class="dashed"></DIV>
				<H2 class="black14"><IMG src="<%=request.getContextPath()%>/product_files/bg_point1.gif" align="absMiddle"> 目录</H2>
				<DIV class="zhengwen"><%=book.getCatalogue()%></DIV>
			</DIV>
			<A class="review_point"></A>
		</DIV>
	</DIV>
</DIV>
<DIV id="tag_box" style="DISPLAY: none; Z-INDEX: 2; POSITION: absolute"></DIV>
<DIV id="tag_box_pay" style="DISPLAY: none; Z-INDEX: 2; POSITION: absolute"></DIV>
<DIV id="div_shield"></DIV><!--页尾 开始 -->
<DIV class="public_footer_add_s"></DIV><!--09.3.10new-->
<!--页尾 end -->
<!--页尾开始 -->
<%@include file="../common/foot.jsp"%>
<!--页尾结束 -->
</BODY>
</HTML>